package com.bening.smsapp.util;

import com.ibm.util.BigInt;
import com.jp.xml.asn1.Base64.Base64Coder;

public class DecoderUtil {
	
	
	public static final String decodeBooleanString(String in) {
		if("".equals(in) || in == null) return "";
		String result = "";
		byte[] b = Base64Coder.decode(in);
		result = String.valueOf(b[0]);
		return result;
	}
	public static final String decodeVisibleString(String in) {
		if("".equals(in) || in == null) return "";
		String result = "";
		byte[] b = Base64Coder.decode(in);
		result = new String(b);
		return result;
	}
	public static final String decodeIntegerString(String in) {
		if("".equals(in) || in == null) return "";
		String result = "";
		byte[] b = Base64Coder.decode(in);
		result = String.valueOf(new BigInt(b));
		return result;
	}

	public static final String decodeBitString(String in, int len) {
		if("".equals(in) || in == null) return "";
		
		String result = "";
		result = com.ibm.xml.asn1.Base64.decodeBitString(in,len);
		return result;
	}
	
	public static final String decodeOctetString(String in) {
		if("".equals(in) || in == null) return "";
		
		String result = "";
		result = com.ibm.xml.asn1.Base64.decodeOctetString(in);
		return result;
	}
}
